package com.zyz.L_泛型.泛型使用;

import java.util.Arrays;

/**
 * @author: vick
 * @Date: 2025/4/2
 * @Description:
 * @version: 1.0
 */
public class RectangleTest {
    public static void main(String[] args) {
        Rectangle[] rectangles = {
                new Rectangle(6,2 ),
                new Rectangle(4,3 ),
                new Rectangle(12,4 ),
                new Rectangle(5,4 ),
        };
        System.out.println("排序之前：");
        for (Rectangle rectangle : rectangles) {
            System.out.println(rectangle);
        }

        Arrays.sort(rectangles);

        System.out.println("排序之后");
        for (Rectangle rectangle : rectangles) {
            System.out.println(rectangle);
        }

    }
}
